//
//  SelectActivityViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/4/6.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "SelectActivityViewController.h"
#import "GuanFongActivityViewController.h"

@interface SelectActivityViewController ()

@end

@implementation SelectActivityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    // navi的修改
    [self changeNavigation];
    // 布局
    [self addMySubview];
}

// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];
    self.navigationItem.title = @"选择活动类型";
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    
}

#pragma mark - 返回上一页面
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 布局
- (void)addMySubview
{
    UIImageView *guanFangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 150 * kAdjustParamater)];
    guanFangImageV.userInteractionEnabled = YES;
    guanFangImageV.image = [UIImage imageNamed:@"活动类型图切图-01"];
   // guanFangImageV.backgroundColor = [UIColor redColor];
    [self.view addSubview:guanFangImageV];
    UITapGestureRecognizer *guanFangTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(guanFang:)];
    [guanFangImageV addGestureRecognizer:guanFangTapGes];
    
    UILabel *grayLineOnGuanFangBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, guanFangImageV.bottom, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnGuanFangBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
    [self.view addSubview:grayLineOnGuanFangBottom];
    
    UIImageView *yongHuImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, grayLineOnGuanFangBottom.bottom, kScreenWidth, 150 * kAdjustParamater)];
    yongHuImageV.userInteractionEnabled = YES;
    yongHuImageV.image = [UIImage imageNamed:@"活动类型图切图-02"];
 //   yongHuImageV.backgroundColor = [UIColor redColor];
    [self.view addSubview:yongHuImageV];
    UITapGestureRecognizer *yongHuTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(yongHu:)];
    [yongHuImageV addGestureRecognizer:yongHuTapGes];
    
    UILabel *grayLineOnYongHuBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, yongHuImageV.bottom, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnYongHuBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
    [self.view addSubview:grayLineOnYongHuBottom];
}

#pragma mark - 官方
- (void)guanFang:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"官方");
    GuanFongActivityViewController *guanFangAcitivityVC = [[GuanFongActivityViewController alloc] init];
    [self.navigationController pushViewController:guanFangAcitivityVC animated:YES];
}

#pragma mark - 用户
- (void)yongHu:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"用户");
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
